const RC4_KEY = 'TheKey';

$(document).ready(function(){
   $('#go').click(function(){
	   $('#page').attr('src', 'd.php?u='+$.rc4EncryptStr($('#u').val(), RC4_KEY));
   });
   
   $('#facebook').click(function(){
	   window.open('http://www.facebook.com/share.php?u='+document.location,'facebookShare','width=640,height=300');
   });
   
   $('#u').keypress(function(e) {
	   if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
		   $('#go').click();
	   }
   });
   
   setInterval( '$(\'#page\').height($(window).height()-34)', 500 );
   
   //setInterval( '$(\'#page\').height($(\'#page\').contents().find(\'body\').height() + 20)', 500 );
   //setInterval( '$(\'#page\').width($(window).width()-0)', 500 );
   //setInterval( '$(\'#page\').width($(window).width()-0)', 500 );
   //setInterval( "if(($.focused()==null || $.focused().id != 'u') && $('#page').attr('src') != null){$('#u').val($.base64.decode($.parseQuerystring($('#page').attr('src')).u))}", 500 );
   //setInterval( "alert($.base64.decode($.parseQuerystring($('#page').attr('src')).u))", 5000 );
 });